import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/lib/theme-chalk/index.css';
import 'dayjs/locale/zh-cn'
import App from './App.vue'
import router from './router/router'
import moment from "moment";
const mixin={
    methods:{
        getDates(startDate,endDate){
            let dates = [];
            let str = moment(startDate);
            let end = moment(endDate);
            if(end.isSameOrAfter(str)){
                for(let i = 0;i < 30;i++){
                    dates.push(moment(str).format("YYYY-MM-DD"));
                    if(end.isAfter(str)){
                        str.add(1,'d');
                    }else {
                        break;
                    }
                }
            }
            return dates;
        },
    }
}

const app =createApp(App);
app.config.globalProperties.$host='http://localhost:8081';
app.use(ElementPlus).use(router);
app.mixin(mixin);
app.mount('#app');
